package dao

import (
	"yuekao3/global"
)

func Losts[T any](data *[]T) bool {
	err := global.DB.Find(data).Error
	if err != nil {
		return false
	}
	return true
}
func GetOneByField[T any](where string, data *T) bool {

	if err := global.DB.Model(data).Where("name like? ", "%"+where+"%").Find(data).Limit(1).Error; err != nil {
		return false
	}
	return true

}
